package com.w.wx.mapper;

import com.w.wx.domain.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

@Mapper
@Component
public interface GoodsMapper {
    int deleteByPrimaryKey(Integer gid);

    int insert(Goods record);

    int updateByPrimaryKey(@Param("gid") int gid ,@Param("fwl") int fwl);


    int updateGoodsState(@Param("state") Integer state, @Param("timeStamp") Timestamp timeStamp,@Param("gid")Integer gid);

    ArrayList<Goods> selectByUser(@Param("flag") String flag);

    void updateGoodsHomeImage(@Param("homeImage") String avator,@Param("gid") Integer gid);

    ArrayList<Goods> selectSimpleByState(@Param("state") Integer state, @Param("startIndex") int startIndex,  @Param("pageSize")int pageSize);

    ArrayList<Goods> selectMySimpleByOpenid(@Param("openid") String openid,@Param("stateJ")int state, @Param("startIndex") int startIndex, @Param("pageSize") int pageSize);

    Goods selectMyCarSimByGid(@Param("gid") Integer gid);

    Goods selectDetailByGid(@Param("gid")Integer gid);

    ArrayList<Goods> selectSimFree(@Param("startIndex") int startIndex, @Param("pageSize") int pageSize);

    Integer selectFwlByGid(Integer gid);

    Integer selectByOpenidForGid(String openid);

    ArrayList<Goods> selectMyCheckSimGoods(String openid);

    List<Goods> selectAll();


    Integer updateGoodsLikeSum(int gid, int likeNum);

    ArrayList<Goods> selectAllByState(String openid,Integer state, @Param("startIndex") int pageNum, @Param("pageSize") int pageSize);
}